bin/prune: Add --only-branch
authorColin Walters <walters@verbum.org>
Fri, 1 Sep 2017 19:55:17 +0000 (15:55 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 18 Sep 2017 17:20:38 +0000 (17:20 +0000)
commitab200495a86d8ff6ef309cf1e89b93275cb96793
tree5e699d94e3f93745828cce432319f359d16e78ce
parent58e4abe4bcd8c4ca4c6e1a321f6f3f441e756a0c
bin/prune: Add --only-branch

In 5c940987e768523ef1411b65bcaad09fba6befef / #646 we
added `--retain-branch-depth`; this adds a symmetric
`--only-branch` for the case where a repo owner just
wants to prune a specific branch.

The implementation here is pretty straightforward; we
just walk all refs and inject the equivalent of
`--retain-branch-depth=$ref=-1` if they're *not* in
`--only-branch`.

Closes: https://github.com/ostreedev/ostree/issues/1115
Closes: #1127
Approved by: jlebon
src/ostree/ot-builtin-prune.c
tests/test-prune.sh